import request from '@/utils/request'

/**
 * 获取验证码
 * @param {String} mobile 手机号
 */
export const reqSendCode = (mobile) => request.get('/v1_0/sms/codes/' + mobile)

/**
 * 登录
 * @param {*} mobile 手机号
 * @param {*} code 验证码
 */
export const reqLogin = (mobile, code) =>
  request.post('/v1_0/authorizations', {
    mobile,
    code
  })

/**
   * 获取个人资料
   */
export const reqGetProfile = () => {
  return request({
    method: 'get',
    url: '/v1_0/user/profile'
  })
}
